﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using Oracle.ManagedDataAccess.Client;
using System.Xml;
using System.Drawing;

// 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“IService”。
[ServiceContract, XmlSerializerFormat]
public interface IService
{
     
	[OperationContract]
	string GetData(int value, Class_Patients tp, Class_Template template, Class_Datacodecs dbcode);

    [OperationContract]
    string GetName(string val);

    #region 数据库操作
    [OperationContract]

    DataSet GetDataSet(string CmdString);

    [OperationContract]

    DataSet GetDataSets(Class_Table[] tabsqls);

    [OperationContract]
    string ReadSqlVal(string CmdString, int rowindex, string colName);

    [OperationContract]
    int ExecuteSQL(string CmdString);

    [OperationContract]
    int ExecuteBatch(string[] BatchSql);

    [OperationContract]

    int ExecuteSQLWithParams(string CmdString, DBParameter[] paremts);

    [OperationContract]
    DateTime GetSystemTime();
    #endregion

    #region 文书操作
    [OperationContract]
    string GetXmlDocs(string textid, string patientid, string Doctype, string NewDocXml);
    #endregion

    #region 文书树操作

    [OperationContract]
    List<UcTreeNode> GetAllText();

    [OperationContract]
    UcTreeNode ReflashBookTree(InPatientInfo inpo);

    [OperationContract]
    UcTreeNode GetFinishNode(string Id);

    [OperationContract]
    Class_Text[] GetSelectClassDs(DataSet tempds);

    [OperationContract]
    DataSet GetCurrentDocInfo(string tid);

    [OperationContract]
    UcTreeNode SelectDoc(string patient_id);

    [OperationContract]
    UcTreeNode SelectDoc2(int id, string tid);

    [OperationContract]
    InPatient_Doc[] GetSelectNodes(string textid, string patient_id);

    [OperationContract]
    void filterInfo(XmlElement bodyElement, InPatientInfo InpatientInfo, int TextKind_id, int Tid);

    [OperationContract] 
    void filterInfo2(XmlElement bodyElement, int TextKind_id);
 
    [OperationContract]
    string DocFromXmlBytText(string text_id, string patient_id);

    [OperationContract]
    InPatient_Doc GetDocbyId(string tid, string patient_id, string doctype);

    [OperationContract]
    int DeleteDocById(string nodeid, string DocType, InPatientInfo inpt, string User_id, string User_name);

    [OperationContract]
    string isExitRecord(int id, int patient_id);

    [OperationContract]
    string GetTextDocXmlById(string tid);

    [OperationContract]
    void SaveDoc(ref int Tid, int TextKind_id, bool blfalse, bool IsMore, string textTitle, string Role_type, string User_id,
                        InPatientInfo InpatientInfo,
                       string haveSuperior, string havaTube, string Belong_ToSys_ID, string SickKind_ID, string OldTextName,
                       string TextSuperiorSignature, string SuporSign, bool haveD, bool isTakeSuperiorZz, bool isTakeSuperiorZr,
                       string qualityTitle, string tempxmldocstr);

    [OperationContract]
    Class_Text GetTextClsById(string id);

    [OperationContract]
    Class_Text[] GetClassTestDsByName(string textname);

    [OperationContract]
    int ChangeTextShowNum(string shownum1, string id1, string shownum2, string id2);

    [OperationContract]
    int InsertText(string txtName, string txtNumber, string cboEditorSelectIndex, string fahterId,
                            string cboBookAttributeSelectedIndex, string mark, string sid, string signatrue, string cboTimeTitle,
                            string fromname, string cboDoctorOrNuser, string isnewpage, string issubmitsign, string isneedsignatrue,
                            string txtOtherTextName);

    [OperationContract]
    int UpdateText(string txtName, string txtNumber, string cboEditorSelectedIndex, string fahterId, string cboBookAttributeSelectedIndex,
                         string mark, string sid, string signatrue, string cboTimeTitle, string fromname, string cboDoctorOrNuser,
                         string isnewpage, string issubmitsign, string isneedsignatrue, string txtOtherTextName, string selectClasstextId);
    #endregion

    #region 帐号的相关操作
    [OperationContract]
    Class_Account GetLoginCurrentAccout(string account, string password);

    [OperationContract]
    bool IsIntimeSpan(string roleid);

    [OperationContract]
    Class_Permission[] GetPermissions();

    [OperationContract]
    void GetCurrentRolePermissions(ref Class_Role CurrentSelectRole);
    #endregion

    #region 病人操作
    [OperationContract]
    DataSet GetInptientByDoctorCode(string sick_doctor_name);

    [OperationContract]
    DataSet GetInptientByStr(string patient_name);

    [OperationContract]
    DataSet GetInptientBySectionCode(string section_id);

    [OperationContract]
    InPatientInfo InitPatient(string patientid);

    [OperationContract]
    void GetAgeByBirthDayInfo(string birthday, ref int year, ref int month, ref int day);

    [OperationContract]
    int PatientInSectionsArea(InPatientInfo inpo, string Account_id);

    [OperationContract]
    DataSet GetSection(string sid, string said);

    [OperationContract]
    DataSet GetSickArea(string sid, string said);

    [OperationContract]
    DataSet GetEmptyBed(string sid,string said);

    [OperationContract]
    DataSet GetDoctor(string sid);

    [OperationContract]
    int Test2(int t1, int t2);

    [OperationContract]
    DataSet GetTextTest();
    #endregion

    #region 模版操作
    [OperationContract]
    string GetDefaultTemp(string textId);
    [OperationContract]
    string GetTemplateByid(string tid);

    [OperationContract]
    UcTreeNode ReflashTemplateBookTree();

    [OperationContract]
    UcTreeNode ReflashTemplateTrvBook(string msg);

    [OperationContract]
    UcTreeNode ReflashTemplateTrvBookByCheckType(string chkDocType, string rdoPersonal, string rdoSection, string rdoHospital,
       string rdoGroup, string txtDocName, string chkAllDefault, string chkAll, string chkSectionDefault, string chkSection, string chkGroupDefault,
       string chkGroup, string chkPerson);

    [OperationContract]
    string GetNodeColor(Class_Patients templates);

    [OperationContract]
    int AddNewTemplate(string sick_Id, string agestyle, string ages,
        string TName, string Shortcut, string TempPlate_Level, string Sex, string SickArea_ID,
        string Creator_ID, string Create_Time, string Updater_ID, string Update_Time,
        string Verify_ID1, string Verify_Time1,
        string Verify_ID2, string Verify_Time2,
        string Verify_Sign, string Section_ID,
        string ISDEFAULT, string TextKind, string Role_type, string xmldocstr);

    [OperationContract]
    int UpdateTemplate(string current_id, string content);

    [OperationContract]
    DataSet GetTemplateByCondition(string msg, string GStyle, string Kindtid, string section_id);

    [OperationContract]
    int DeleteTemplate(string tid);

    [OperationContract]
    DataSet GetTemplateChildNodesOrder(string parentid);

    [OperationContract]
    int SetTemplateChildNodesOrder(string autotype, List<string> conditons);

    #endregion

    #region 知识库操作
    [OperationContract]
    DataSet GetDataSetTABLE_F();

    [OperationContract]
    DataSet GetDataSetTABLE_E(string id);

    [OperationContract]
    int DeleteTable_F(string ID, string parentId);

    [OperationContract]
    DataSet GetObjectDataById(string ObjectId);

    [OperationContract]
    int SaveSimpleElement(string SaveType, string txtNum, string txtName, string txtCode, string selnodeText, string selnodeTag,ref string id);

    [OperationContract]
    int SaveComplexElement(string SaveType, string tvDirectorySelectedText, string tvListSelectedNodeName,
        string txtComplexName, string tvDirectorySelectedTag, string tvListSelectedNodeTag, 
        string tvListCount, string DocXML,ref string id, ref string evalueCode);

    [OperationContract]
    int ElementDelete(string delType, string id, string objectid);
    #endregion

    #region   基础数据操作
    [OperationContract]
    DataSet GetAllSection();

    [OperationContract]
    List<FixTypeObject> GetFixTypeObjects();

    [OperationContract]
    DataSet GetDataSetByType(string type);

    [OperationContract]
    DataSet GetCitysByProviceId(string provinceId);
    #endregion

    //TODO: 在此添加您的服务操作
}

// 使用下面示例中说明的数据约定将复合类型添加到服务操作。
[DataContract]
public class CompositeType
{
	bool boolValue = true;
	string stringValue = "Hello ";

	[DataMember]
	public bool BoolValue
	{
		get { return boolValue; }
		set { boolValue = value; }
	}

	[DataMember]
	public string StringValue
	{
		get { return stringValue; }
		set { stringValue = value; }
	}    
}

/*
[DataContract]
public class Param
{
    //参数名
    string _paramname;
    //参数值
    object _paramvalue;
    //参数类型
    OracleDbType _paramtype;
    //参数大小
    int _paramsize;


    [DataMember]
    public string ParamName
    {
        get { return _paramname; }
        set { _paramname = value; }
    }

    [DataMember]
    public object ParamValue
    {
        get { return _paramvalue; }
        set { _paramvalue = value; }
    }

    [DataMember]
    public OracleDbType ParamType
    {
        get { return _paramtype; }
        set { _paramtype = value; }
    }

    [DataMember]
    public int ParamSize
    {
        get { return _paramsize; }
        set { _paramsize = value; }
    }
}*/
